<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div>
      <a-form @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="12">
            <a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input placeholder="请输入名称" v-model="queryParam.name"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item>
              <a-button type="primary" @click="searchQuery()" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset()" icon="reload" style="margin-left: 8px">重置</a-button>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <div>
      <vxe-grid
        id="MultitenantList"
        ref="vxeTable"
        v-bind="gridOptions"
        :row-config="{keyField:'id'}"
      >
      <template #action="{ row }">
        <!-- <a @click="handleEdit(row)">编辑</a> -->
        <a-divider type="vertical" />
        <a-dropdown>
          <a class="ant-dropdown-link">
            更多 <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
            <a-menu-item>
              <a href="javascript:;" @click="handleDetail(row)">详情</a>
            </a-menu-item>
            <!-- <a-menu-item v-if="row.status === '01'">
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(row.code)">
                <a>删除</a>
              </a-popconfirm>
            </a-menu-item> -->
          </a-menu>
        </a-dropdown>
      </template>
    </vxe-grid>
    </div>
    <MultitenantModal @ok="modalFormOk" ref="modalForm" />
  </a-card>
</template>

<script>
import VxeTableListMixin from '@/mixins/VxeTableListMixin'
import MultitenantModal from './modules/MultitenantModal'
export default {
  name: 'MultitenantList',
  components: { MultitenantModal },
  mixins: [VxeTableListMixin],
  data() {
    return {
      columns: [
        { type: 'seq', width: 60 },
        { title: '租户ID', field: 'id' },
        { title: '租户名称', field: 'name' },
        { title: '数据源', field: 'dataSourceInfoId' },
        { title: '操作', slots: { default: 'action' }, width: 170 }
      ],
      url: {
        list: '/multitenant/org/page'
      },
      sortConfig: {
        defaultSort: {
          field: 'name',
          order: 'desc'
        }
      }
    }
  },
  methods: {

  }
}
</script>

